import de.bht.fb6.cg1.exercise3.RowVector;
import de.bht.fb6.cg1.exercise3.implement.*;


public class TestApp {

	/**
	 * @param args
	 * @throws IllegalAccessException 
	 * @throws InstantiationException 
	 */
	@SuppressWarnings("unchecked")
	public static void main(String[] args) {
		Integer[][] values = {
				{ 1, 0, 0, 3 }
		};
		RowVector<Integer> u = new RowVectorImpl<Integer>(values, IntRing.class);
		values = new Integer[][] {
				{ 0, 1, 1, 1 }
		};
		RowVector<Integer> v = new RowVectorImpl<Integer>(values, IntRing.class);
		values = new Integer[][] {
				{ 3, 0, 1, 4 }
		};
		RowVector<Integer> w = new RowVectorImpl<Integer>(values, IntRing.class);
		values = new Integer[][] {
				{ 1 }, { 0 }, { 0 }, { 3 }
		};
		ColumnVectorImpl<Integer> u1 = new ColumnVectorImpl<Integer>(values, IntRing.class);
		values = new Integer[][] {
				{ 0 }, { 1 }, { 1 }, { 1 }
		};
		ColumnVectorImpl<Integer> v1 = new ColumnVectorImpl<Integer>(values, IntRing.class);
		values = new Integer[][] {
				{ 3 }, { 0 }, { 1 }, { 4 }
		};
		ColumnVectorImpl<Integer> w1 = new ColumnVectorImpl<Integer>(values, IntRing.class);
		
		values = new Integer[][] {
				{ 0, 1, 2 },
				{ 3, 2, 1 },
				{ 1, 1, 0 }
		};
		SquareMatrixImpl<Integer> C = new SquareMatrixImpl<Integer>(values, IntRing.class);
		
		System.out.println("C = " + C);
		System.out.println("det(C) = " + C.getDeterminant());
		System.out.println("adj(C) = " + C.getAdjugate());
		System.out.println("C * adj(C) = " + C.mult(C.getAdjugate()));
		System.out.println("u = " + u);
		System.out.println("v = " + v);
		System.out.println("w = " + w);
		System.out.println("u.cross(v,w) = " + u.crossProduct(v,w));
		System.out.println("u.cross(v,w).dot(u) = " + u.crossProduct(v,w).dotProduct(u));
		System.out.println("u.cross(v,w).dot(v) = " + u.crossProduct(v,w).dotProduct(v));
		System.out.println("u.cross(v,w).dot(w) = " + u.crossProduct(v,w).dotProduct(w));
		System.out.println("u.cross(v,w).abs() = " + new RowVectorImpl<Integer>(u.crossProduct(v,w), IntRing.class).absolute());
		System.out.println("u1.cross(v1,w1) = " + u1.crossProduct(v1,w1));
		System.out.println("u1.cross(v1,w1).dot(u1) = " + u1.crossProduct(v1,w1).dotProduct(u1));
		System.out.println("u1.cross(v1,w1).dot(v1) = " + u1.crossProduct(v1,w1).dotProduct(v1));
		System.out.println("u1.cross(v1,w1).dot(w1) = " + u1.crossProduct(v1,w1).dotProduct(w1));
		System.out.println("u1.cross(v1,w1).abs() = " + u1.crossProduct(v1,w1).absolute());
		
	}

}
